<template>
     <el-dialog
      :close-on-click-modal="clickClose" 
      :title="title" 
      :visible.sync="visible"

      >
           <slot></slot>
        <div slot="footer" v-if="slot!=='footer'">
                <el-button @click="visible=false">取消</el-button>
                <el-button
                type="primary" 
                :loading="confirmLoaing"
                @click="$emit('confirm')"
                >确定</el-button>
        </div>
     </el-dialog>
</template>

<script>
    export default {
        name:"MyDialog",
        data() {
            return {
                visible:false,
                confirmLoaing:false,
            }
        },
        methods: {
           show(){
              this.visible=true;
           },
           hide(){
               this.visible=false;
           },
           start(){
               this.confirmLoaing=true;
           },
        
           stop(){
               this.confirmLoaing=false;
           }
        },
        props:{
            title:String,
            clickClose:Boolean,
        }
    }
</script>

<style scoped lang="scss">

</style>